package com.donleo.stmg.entity.service;

import com.donleo.stmg.common.api.CommonResult;
import com.donleo.stmg.entity.model.Permission;
import com.baomidou.mybatisplus.extension.service.IService;
import com.donleo.stmg.entity.vo.PermissionVo;
import com.donleo.stmg.entity.vo.TreeVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 权限表 服务类
 * </p>
 *
 * @author liangd
 * @since 2020-12-21
 */
public interface PermissionService extends IService<Permission> {

    List<Permission> findAll(PermissionVo permissionVo);

    long getCount(PermissionVo permissionVo);

    CommonResult add(Permission permission);

    CommonResult deletes(List<Integer> idsList);

    CommonResult updatePermisson(Permission permission);

    /**
     * 查询所有菜单
     */
    Map<String, Object> findMenuTree(Integer type);

    /**
     * 根据角色编号查权限
     */
    List<Permission> findPmsByRoleCode(String roleCode);

    /**
     * 分配菜单权限
     *
     * @param treeVo
     * @return
     */
    CommonResult getMenuTreeData(List<TreeVo> treeVo, String roleCode, Integer type);

    /**
     * 根据用户生成菜单
     *
     * @param userCode
     * @return
     */
    Map<String, Object> findUserMenuPermission(String userCode);
}
